package com.qf.controller;

import com.qf.pojo.Admin;
import com.qf.service.AdminService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 作者：冯国清
 * 项目名：com.qf.controller
 * 时间：2020/7/30 19:37
 * 描述:
 */@Controller
public class AdminController {
     @Resource
     private AdminService adminService;
     @RequestMapping("/login")
     @ResponseBody
     public String Login(HttpServletRequest request){
         String username = request.getParameter("username");
         String password = request.getParameter("password");
         Admin login = adminService.login(username, password);
         System.out.println(login);
         if (login!=null){


             return "1";
         }
       return "0";

     }

}
